1) Field of the Invention
The present invention relates to a barcode reader that reads a barcode (characters) based on light reflected from the barcode (binary information) in which characters are expressed by bar width by using a difference in reflectance of light, a method of reading barcode, a computer program for reading barcode and a module-point extracting unit, and more particularly, to a barcode reader that enables to improve a processing speed, a method of reading barcode, a computer program for reading barcode, and a module-point extracting apparatus.
2) Description of the Related Art
Conventionally, in a field of distribution of products, a barcode that is provided on a product is read optically and information related to the product such as a price and a name of the product is recorded in a register.
In a barcode, information related to a product is encoded as characters and is combined as alternate black and white bars. In a barcode reader, beam light that is emitted from a laser diode is made to scan the barcode, reflected light of the beam is received, and barcode information is read from an electric signal corresponding to width of black bars and white bars.
In this case, the barcode is printed on various media such as an organic material, a can, and mainly a paper.
FIG. 21 is a perspective view of an external configuration of a barcode reader 20. FIG. 22 is a block diagram of an electrical configuration of the barcode reader 20 shown in FIG. 21.
The barcode reader 20 is a reader that reads a barcode 10 optically. In the barcode reader 20 shown in FIG. 22, a laser diode 21 emits light beam L for scanning.
A polygon mirror 22 is formed by a mirror that causes the light beam L from the laser diode 21 to reflect, and is rotated by a motor (omitted in the diagram), and imparts scanning patterns of a plurality of types by changing a direction of reflection of the light beam L.
The light beam L that is reflected by the polygon mirror 22 is irradiated by a reading window 20b that is provided on a housing 20a shown in FIG. 21 on black bars and white bars of the barcode 10 in a direction from a left edge to a right end. A light receiver 23 receives reflected light of the light beam L that is irradiated on the barcode 10 and performs photoelectric conversion to convert the reflected light to an electric signal of an amplitude value according to intensity of the reflected light. An amplifier 24 amplifies a signal from the light receiver 23, which is subjected to photoelectric conversion.
An analog/digital (A/D) converter 25 performs digital sampling of an analog signal that is subjected to photoelectric conversion, which is amplified by the amplifier 24, and outputs as a digital signal that is subjected to photoelectric conversion. An extractor 26, to reduce a signal processing in a latter stage, extracts from the signal that is subjected to photoelectric conversion from the A/D converter 25, only a signal that is reflected from the barcode 10.
A band-limiting differentiator 27, by using module frequency 2f0 that is extracted by a module-frequency extractor 28, which is mentioned later, performs a differentiation process for limiting a band of an output signal of the extractor 26, and outputs a narrow-band differential signal S1 of a waveform pattern shown in FIG. 25 to an amplitude extractor 29 for each module point.
FIG. 26 is a diagram showing a concrete waveform of the narrow-band differential signal S1 shown in FIG. 23.
Thus, the narrow-band differential signal S1 has a waveform such that at a point of switching from the black bar to the white bar, an amplitude is converged to the maximum value, at a point of switching from the white bar to the black bar, the amplitude is converged to the minimum value, and at a flat portion of the black bar and the white bar, the amplitude is converged to zero.
The module-frequency extractor 28 performs processes such as a differentiation process and a squaring process on the output signal of the extractor 26, obtains a frequency spectrum 61 shown in FIG. 24 by an Fast Fourier Transform (FFT) process of a differentiated and squared signal, and calculates frequency of a gain peak of the frequency spectrum 61 as a module frequency (2f0) equivalent to a basic module of the barcode.
The amplitude extractor 29 for each module point shown in FIG. 22 with the narrow-band differential signal S1 and the module frequency 2f0 as input, is provided with a function of extracting a module point corresponding to a boundary of the black bar and the white bar and a function of extracting an amplitude value of the narrow-band differential signal S1, and outputs a ternarized pattern S2 (see FIG. 31A) of “+1”, “0”, and “−1” with the amplitude value as an edge signal.
FIG. 23 is a block diagram that shows an electrical configuration of the amplitude extractor 29 for each module point. In the amplitude extractor 29 for each module point shown in FIG. 23, a gain-characteristic calculating unit 30 calculates gain characteristic 60 shown in FIG. 24 based on the module frequency 2f0 from the module-frequency extractor 28 (see FIG. 22).
The gain characteristic 60 is for determining filtering of a band pass in a band pass filter (BPF) 32 that is mentioned later and is expressed by parameters such as a module frequency error Δf, a bandwidth fw, and a roll-off factor ROF. These parameters are important values that control an accuracy of barcode reading.
The module frequency error Δf is equivalent to an error in the module frequency 2f0 that is mentioned above. Therefore, a mean frequency of the gain characteristic (bandwidth fw) becomes the module frequency 2f0+ the module frequency error Δf.
Referring back to FIG. 23, an inverse Fast Fourier Transform (IFFT) unit 31 performs inverse Fast Fourier Transform on an output of the gain-characteristic calculating unit 30, calculates a filter coefficient corresponding to the gain characteristic 60 mentioned below, and sets it in the BPF 32.
The BPF 32, based on the filter coefficient corresponding to the gain characteristic 60 shown in FIG. 24, causes the narrow-band differential signal S1 of a waveform pattern shown in FIG. 26 (FIG. 25) to bandpass and outputs a waveform pattern shown in FIG. 27.
In FIG. 27, a waveform with crosses on sample points corresponds to a real part Re and a waveform with circles on sample points corresponds to an imaginary part Im that is subjected to a Hilbert conversion by a Hilbert converter 33. In FIG. 27, a signal of each sample point is vectorized (real part and imaginary part).
Thus, the Hilbert converter 33 is a converter that performs Hilbert conversion of an output signal of the BPF 32 and is provided with a function of vectorizing a signal of each sample point.
Practically, the BPF 32 is a digital filter in which the gain characteristic is set by setting a tap coefficient.
A phase calculating unit 34 calculates a phase of a vector signal that is input. A zero-degree point extractor 36 extracts a point for which a phase becomes 0° by an output of the phase calculating unit, as a sample point. A phase integrator 35 integrates in units of samples the phase that is calculated by the phase calculating unit 34.
A delay-time calculating unit 37 calculates a delay time between the sample point and a point that becomes 0° in FIG. 26. A delay-filter-coefficient calculating unit 38 calculates a delay filter coefficient based on the delay time calculated by the delay-time calculating unit 37, and sets it in a delay filter 39.
The delay filter 39 performs delaying process on the narrow-band differential signal S1 based on the delay filter coefficient, is a filter for causing the sample point to coincide with a zero-degree timing point, and outputs a waveform pattern shown in FIG. 29.
A least mean square (LMS) unit 40 performs an equalization process on an output signal from the delay filter 39 by a method of least squares, and outputs a signal of a waveform pattern shown in FIG. 30.
A ternary processor 41, based on a comparison of amplitude and a threshold value, ternarizes an output of the LMS unit 40 (see FIG. 30) to any one of “+1”, “0”, and “−1”, and output a ternarized pattern S2 of circled portions shown in FIG. 31A.
For example, the ternarized pattern of the circled portions shown in FIG. 31A is demodulated to a character pattern (character string) of the barcode shown in FIG. 31B by a character demodulator 42 (see FIG. 22).
This character pattern is transmitted as a reading result to a host computer 50 by an I/F unit 43 (see FIG. 22).
However, in the conventional barcode reader 20, since the filter coefficient that is to be set in the BPF 32 shown in FIG. 23 is calculated by a method that has many steps of a process called as an inverse Fast Fourier Transform in the IFFT unit 31, there has been a problem of leading to a fall in a processing speed.
Moreover, in the conventional barcode reader 20, for filtering a signal of a narrow-band called as the narrow-band differential signal, the number of taps (for example, 127) of the BPF 32 becomes large and the number of the processing steps increases, thereby leading to a problem of the processing speed becoming slow.
Moreover, in the conventional barcode reader 20, for performing the Hilbert conversion in the Hilbert converter 33 for generating a Hilbert signal, due to a large number of processing steps in this case as well, there has been a problem of leading to the fall in the processing speed.
In FIG. 32, details of an overall throughput in the conventional barcode reader 20 are shown diagrammatically. In FIG. 32, a unit throughput, the number of times, and an overall throughput (unit throughput×number of times) in each processing unit (the gain-characteristic calculating unit 30, the IFFT unit 31, . . . , and the delay filter 39) is shown diagrammatically.
According to FIG. 32, an overall throughput of the IFFT unit 31 mentioned above is 21934 steps. An overall throughput of the BPF 32 is 135000 steps. Moreover, an overall throughput of the Hilbert converter 33 is 73000 steps. The total of the throughput in the barcode reader 20 is 291157 steps.